<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>车辆信息录入</title>

<style type="text/css">

.tbt{text-align:center;background:#CCCCCC;font-weight:bold;}
.req{color: red}
</style>

<script type="text/javascript" src="<%=request.getContextPath()%>/resource/js/My97DatePicker/WdatePicker.js"></script>

</head>
<body>

<form name="carForm" action="<%=request.getContextPath()%>/car/save" method="post">

<c:if test="${!empty model}">
	<input type="hidden" name="id" value="${model.id }"/>
</c:if>
	
<table width="100%" border="1">

	<colgroup>
		<col style="width:15%" />
		<col style="width:24%" />
		<col style="width:18%" />
		<col style="width:21%" />
	</colgroup>

	<tr>
		<th class="tbt" colspan="4">车辆基本信息</td>
	</tr>
	
	<tr>
		<td>车辆品牌</td>
		<td><input type="text" id="cCarBrand" name="brand" value="${model.brand }"><span class="req">*</span></td>
		<td>车辆牌照号</td>
		<td><input type="text" id="cCarNumber" name="number" value="${model.number }"><span class="req">*</span></td>
	</tr>
				  
	<tr>
		<td>车辆系别</td>
		<td>
			<select id="cCarSeries" name="series">
				<option value="1" ${model.series=='1'?'selected="selected"':'' }>德系</option>
				<option value="2" ${model.series=='2'?'selected="selected"':'' }>美系</option>
				<option value="3" ${model.series=='3'?'selected="selected"':'' }>法系</option>
				<option value="4" ${model.series=='4'?'selected="selected"':'' }>日系</option>
				<option value="5" ${model.series=='5'?'selected="selected"':'' }>韩系</option>
				<option value="6" ${model.series=='6'?'selected="selected"':'' }>其它</option>
			</select>
		</td>
		<td>车辆架子号</td>
		<td><input type="text" id="cCarFrameID" name="frameid" value="${model.frameid }" tip="输入英文,数字,下划线的架子号(必输入项)" check="2"><span class="req">*</span></td>
	</tr>
				  
	<tr>
		<td>车辆颜色</td>
		<td>
			<select id="cCarColor" name="color">
				<c:forEach items="${colors}" var="c">
					<option value="${c.key}" ${model.color==c.key?'selected="selected"':'' }>${c.value }</option>
				</c:forEach>
			</select>
		</td>
		<td>车辆发动机号</td>
		<td><input type="text" id="cCarEngineID" name="engineid" value="${model.engineid }" tip="输入英文,数字,下划线的发动机号(必输入项)" check="2"><span class="req">*</span></td>
	</tr>
				  
	<tr>
		<td>车辆排量</td>
		<td><input type="text" id="cCarDisplacement" name="displacement" value="${model.displacement }" size="3">升</td>
		<td>车辆上牌日期</td>
		<td><input class="Wdate" type="text" id="dNumberDate" name="numberDate" 
			value="<fmt:formatDate value="${model.numberDate}" pattern="yyyy-MM-dd" />" readonly="readonly" size="9" onclick="WdatePicker()"><span class="req">*</span></td>
	</tr>
				
	<tr>
		<td>车辆行驶里程</td>
		<td><input type="text" id="cCarMileage" name="mileage" value="${model.mileage}" size="3">万公里</td>
		<td>车辆保险日期</td>
		<td>
			<input class="Wdate" type="text" id="dInsuranceDate" name="insuranceDate" 
				value="<fmt:formatDate value="${model.insuranceDate }" pattern="yyyy-MM-dd" />" readonly='readonly' size="9" onclick="WdatePicker()" />
		</td>
	</tr>
				
	<tr>
		<td>车辆运输类型</td>
		<td>
			<select id="cCarType" name="type">
				<option value="1" ${model.type=='1'?'selected="selected"':'' }>客运</option>
				<option value="2" ${model.type=='2'?'selected="selected"':'' }>货运</option>
			</select>
			<span class="req">*</span>
		</td>
		<td>车辆是否有车船税</td>
		<td>
			<select id="cIsCarTax" name="isCarTax">
				<option value="1" ${model.isCarTax=='1'?'selected="selected"':'' }>有</option>
				<option value="2" ${model.isCarTax=='2'?'selected="selected"':'' }>无</o
			</select>
			<span class="req">*</span>
		</td>
	</tr>
				  
	<tr>
		<td style="color:red;">车辆报废日期</td>
		<td>???</td>
		<td>车辆验车日期</td>
		<td>
			<input type="text" id="dCarCheckDate" name="checkDate" value="<fmt:formatDate value="${model.checkDate}" pattern="yyyy-MM-dd" />" readonly="readonly" size="9" onclick="WdatePicker()" />
			<span class="req">*</span>
		</td>
	</tr>
				  
	<tr>
		<td>车辆配置</td>
		<td><textarea id="cCarConfigure" name="configure">${model.configure}</textarea></td>
 		<td>车辆备注</td>
		<td><textarea id="cCarNote" name="note">${model.note }</textarea></td>
	</tr>

<!-- 
	<tr>
		<td>车辆图片</td>
		<td colspan="3"><iframe frameborder="0" width="575" height="100" src="ImagePreviewd.jsp" /></td>
		<td colspan="3"><iframe frameborder="0" width="575" height="100" src="about:blank"></iframe></td>
	</tr> -->
				
	<tr>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	</tr>
				
	<tr>
	  <td class="tbt" colspan="4">车辆买卖信息</td>
	</tr>
	
	<tr>
		<td>车辆本主姓名</td>
		<td><input type="text" id="cSalerName" name="salerName" value="${model.salerName}" size="8" tip="输入汉字的姓名(必输入项)" check="2" /><span class="req">*</span></td>
		<td>车辆买主姓名</td>
		<td><input type="text" id="cBuyerName" name="buyerName" value="${model.buyerName }" size="8" tip="输入汉字的姓名" check="1" /></td>
	</tr>
	
	<tr>
		<td>车辆本主电话</td>
		<td><input type="text" id="cSalerTel" name="salerTel" value="${model.salerTel }" size="15" tip="输入合法手机号码(必输入项)" check="2"><span class="req">*</span></td>
		<td>车辆买主电话</td>
		<td><input type="text" id="cBuyerTel" name="buyerTel" value="${model.buyerTel }" size="15" tip="输入合法手机号码" check="1" /></td>
	</tr>
	
	<tr>
		<td>车辆本主身份证号</td>
		<td><input type="text" id="cSalerCardID" name="salerCardid" value="${model.salerCardid }" size="18" tip="输入合法身份证号码" check="1" /></td>
		<td>车辆买主身份证号</td>
		<td><input type="text" id="cBuyerCardID" name="buyerCardid" value="${model.buyerCardid }" size="18" tip="输入合法身份证号码" check="1" /></td>
	</tr>
	
	<tr>
		<td>车辆本主地址</td>
		<td><input type="text" id="cSalerAddr" name="salerAddr" value="${model.salerAddr}" /></td>
		<td>车辆买主地址</td>
		<td><input type="text" id="cBuyerAddr" name="buyerAddr" value="${model.buyerAddr}" /></td>
	</tr>
	
	<tr>
		<td>车辆销售时间</td>
		<td><input class="Wdate" type="text" id="dCarSaleDate" name="saleDate" value="<fmt:formatDate value="${model.saleDate}" pattern="yyyy-MM-dd" />" readonly="readonly" size="9" onclick="WdatePicker()" /></td>
		<td>车辆中介ID</td>
		<td><input type="text" id="cInterID" name="interId" value="${model.interId }" readonly="readonly" /></td>
	</tr>
	
	<tr>
		<td>车辆过户时间</td>
		<td><input type="text" id="dCarTransferDate" name="transferDate" value="<fmt:formatDate value="${model.transferDate}" pattern="yyyy-MM-dd" />" readonly="readonly" size="9" onclick="WdatePicker()" /></td>
		<td>车辆修理厂ID</td>
		<td><input type="text" id="cRepairID" name="repairId" value="${model.repairId}" readonly="readonly" /></td>
	</tr>
	
	<tr>
		<td>车辆买卖过程备注</td>
		<td><textarea id="cBuySaleNote" name="buySaleNote">${buySaleNote}</textarea></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	
	<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
	
	<tr>
		<td class="tbt" colspan="4">车辆价格信息</td>
	</tr>
	
	<tr>
		<td>车辆买价</td>
		<td><input type="text" id="dCarCost" name="cost" value="${model.cost}" tip="输入金额,保留两位小数(必输入项)" check="2" /><span class="req">*</span></td>
		<td>车辆配件费用</td>
		<td><input type="text" id="dAccessoriesCost" name="accessoriesCost" value="${model.accessoriesCost }" tip="输入金额,保留两位小数" check="1" /></td>
	</tr>
	
	<tr>
		<td>车辆售价</td>
		<td><input type="text" id="dCarPrice" name="price" value="${model.price }" tip="输入金额,保留两位小数(必输入项)" check="2" /><span class="req">*</span></td>
		<td>车辆维修费用</td>
		<td><input type="text" id="dRepairCost" name="repairCost" value="${model.repairCost }" tip="输入金额,保留两位小数" check="1" /></td>
	</tr>
	
	<tr>
		<td>车辆中介费用</td>
		<td><input type="text" id="dInterCost" name="interCost" value="${model.interCost}" tip="输入金额,保留两位小数" check="1" /></td>
		<td>车辆过户费用</td>
		<td><input type="text" id="dTransferCost" name="transferCost" value="${model.transferCost }" tip="输入金额,保留两位小数" check="1" /></td>
	</tr>
	
	<tr><td colspan="4">&nbsp;</td></tr>
	
	<tr><td colspan="4" style="text-align:center;"><input type="submit" id="sbbutton" value="保存" ></td></tr>
</table>

</form>

</body>
</html>